//
//  ZQKFeeSettingPage.m
//  jianzhik
//
//  Created by huami on 2018/8/30.
//  Copyright © 2018年 WKWebView. All rights reserved.
//

#import "ZQKFeeSettingPage.h"
#import "ZQKFeeSettingTableViewCell.h"
#import "ZQMoneyModels.h"
#import <MJExtension/MJExtension.h>
@interface ZQKFeeSettingPage ()
/** listArr */
@property (nonatomic, copy) NSMutableArray <ZQMoneyModels *> *listMuArr;
@end

@implementation ZQKFeeSettingPage
- (NSMutableArray<ZQMoneyModels *> *)listMuArr
{
    if (!_listMuArr) {
        _listMuArr = [[NSMutableArray alloc] init];
    }
    return _listMuArr;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [ZQAFHelper afnetworkRequestWithGetURL:@"/v1/user/listcoin" parameters:parameters view:self.view finishedBlcok:^(NSDictionary *dict) {
     
        NSArray *arr = dict[@"Data"];
        if (arr.count == 0) {
            [UIHelper showTipsWithText:@"请使用超级管理员账号添加币种" inView:self.view completion:^{
                [self.navigationController popViewControllerAnimated:YES];
                return;
            }];
        } else {
        self.listMuArr = [ZQMoneyModels mj_objectArrayWithKeyValuesArray:arr];
        [UIHelper dismissLoadingInView:self.view];
            [self.tableView reloadData];
      }
    }];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self registerCell:[ZQKFeeSettingTableViewCell class]];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);

}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.listMuArr.count;
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 96;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 20;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    ZQKFeeSettingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID  forIndexPath:indexPath];
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    cell.model = self.listMuArr[indexPath.row];

    return cell;
}
@end
